<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
    <div class="container">
        <div class="content">垂直居中</div>
    </div>
    <style>
       .container {
            display: flex;
            align-items: center; /* 垂直居中 */
            justify-content: center; /* 水平居中 */
            height: 100vh;
            width: 100vh;
            background-color: red;

       }

       .content {
            background-color: #ff69b4;
            padding: 20px;
            border-radius: 10px;
            color: white;
        }
    </style>
</body>
</html>
